package com.fifth.business.controller;

import com.fifth.business.service.AppealService;
import com.fifth.common.pojo.dto.CommonResult;
import com.fifth.common.pojo.entity.Appeal;
import com.fifth.common.pojo.entity.BusinessInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/business/appeal")
public class AppealController {

    @Autowired
    private AppealService appealService;

    /**
     * 商家申诉查询
     */
    @PostMapping("/shensu")
    public CommonResult getShenSu(@RequestBody Appeal appeal, @RequestParam(defaultValue = "1") Integer currentPage, @RequestParam(defaultValue = "5") Integer pageSize){
        return appealService.appealQuery(appeal,currentPage,pageSize);

    }
    /**
     * 审核通过
     */
    @PostMapping("/tongguo")
    public CommonResult getTongGuo( String id, Integer status ){
        return appealService.tongguo(id,status);

    }

    /**
     * 审核驳回
     */
    @PostMapping("/bohui")
    public CommonResult getTbohui( String id, Integer status){
        return appealService.bohui(id,status);
    }

    /**
     * 商家申诉
     */
    @PostMapping("shangjiashensu")
    public CommonResult shangjiashensu(@RequestBody Appeal appeal){
        return appealService.shangjiashensu( appeal);
    }

}
